package com.springmvc.service.impl;

import com.springmvc.dao.UserDao;
import com.springmvc.entity.User;
import com.springmvc.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Vitelon on 2017-03-30
 * 用户service实现类
 */
@Service("UserService")
public class UserServiceImpl implements UserService {

    @Resource(name = "UserDao")
    private UserDao userDao;

    public User findByUsernameAndPwd(String name, String pwd) {

        return userDao.findByUsernameAndPwd(name, pwd);
    }

    public List<User> find(User user) {

        return userDao.find(user);
    }

    public List<User> findUserInfo(String username) {
        return userDao.findUserInfo(username);
    }

    public int add(User user) {

        return userDao.add(user);
    }

    public int update(User user) {

        return userDao.update(user);
    }

    public int delete(String id) {
        return userDao.delete(id);
    }
}